package com.zito.health.service.impl;

import com.zito.health.entity.LaboratoryIncharge;
import com.zito.health.mapper.LaboratoryInchargeMapper;
import com.zito.health.service.LaboratoryInchargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: gxt
 * @time: 2019/11/11 10:45
 */
@Service
public class LaboratoryInchargeServiceImpl implements LaboratoryInchargeService {

    @Autowired
    private LaboratoryInchargeMapper laboratoryInchargeMapper;

    @Override
    public LaboratoryIncharge save(LaboratoryIncharge object) {
        int res = laboratoryInchargeMapper.insertSelective(object);
        return object;
    }

    @Override
    public void delete(Integer id) {
        laboratoryInchargeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(LaboratoryIncharge object) {
        laboratoryInchargeMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<LaboratoryIncharge> query() {
        return laboratoryInchargeMapper.selectAll();
    }

    @Override
    public List<LaboratoryIncharge> query(LaboratoryIncharge object) {
        return laboratoryInchargeMapper.select(object);
    }

    @Override
    public LaboratoryIncharge queryOne(LaboratoryIncharge object) {
        return laboratoryInchargeMapper.selectOne(object);
    }

    @Override
    public LaboratoryIncharge queryById(Integer id) {
        LaboratoryIncharge object = laboratoryInchargeMapper.selectByPrimaryKey(id);
        return object;
    }

    @Override
    public boolean exists(Integer id) {
        return laboratoryInchargeMapper.existsWithPrimaryKey(id);
    }

}
